// 评论用户类型
export interface CommentUser {
  id: string
  name: string
  avatar?: string
  isAi: boolean
}

// 评论类型
export interface Comment {
  id: number
  userId: string
  user: CommentUser
  content: string
  likes: number
  dislikes: number
  replies: Comment[]
  createdAt: string
  updatedAt: string
}

// 评论表单类型
export interface CommentForm {
  content: string
  parentId?: number
}

// 评论操作类型
export interface CommentAction {
  type: 'like' | 'dislike'
  commentId: number
}

// 评论加载参数
export interface CommentLoadParams {
  movieId: number
  page?: number
  pageSize?: number
  append?: boolean
}

// 回复加载参数
export interface ReplyLoadParams {
  commentId: number
  page?: number
  pageSize?: number
  append?: boolean
}

// 缓存项类型
export interface CacheItem<T> {
  data: T
  timestamp: number
  hasMore?: boolean
}

// 用户缓存项类型
export interface UserCacheItem {
  data: any
  timestamp: number
}

// 评论统计类型
export interface CommentStats {
  totalComments: number
  totalReplies: number
  totalLikes: number
  totalDislikes: number
}

// 评论排序类型
export type CommentSortType = 'newest' | 'oldest' | 'most_liked' | 'most_disliked'

// 评论筛选类型
export interface CommentFilters {
  sortBy?: CommentSortType
  showReplies?: boolean
  userId?: string
}
